﻿using Mrhd.Core.Entities;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Mrhd.Application
{
    /// <summary>
    /// 商品服务
    /// </summary>
    public interface IProductService
    {
        /// <summary>
        /// 获取商品类型列表
        /// </summary>
        Task<List<ProductTypeEntity>> GetProductTypesAsync();

        /// <summary>
        /// 根据商品类型获取指定的商品获取商品
        /// </summary>
        /// <returns></returns>
        Task<List<ProductEntity>> GetProductsAsync(int typeId, int status, string key, PagingQuery paging);

        /// <summary>
        /// 生成商品类型
        /// </summary>
        /// <param name="types">商品实体列表</param>
        /// <returns></returns>
        Task SaveProductTypeAsync(IEnumerable<ProductTypeEntity> types);

        /// <summary>
        /// 获取商品类型下最大的商品排序码
        /// </summary>
        /// <param name="typeId"></param>
        /// <returns></returns>
        Task<int> GetProductMaxSortAsync(int typeId);

        /// <summary>
        /// 创建商品
        /// </summary>
        /// <param name="product"></param>
        /// <returns></returns>
        Task<ProductEntity> CreateProductAsync(ProductEntity product);

        /// <summary>
        /// 更新商品
        /// </summary>
        /// <param name="product"></param>
        /// <returns></returns>
        Task<ProductEntity> UpdateProductAsync(ProductEntity product);

        /// <summary>
        /// 更改商品售卖状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        Task<bool> ChangeStatusAsync(int id, ProductStatus status);

        /// <summary>
        /// 批量更改商品售卖状态
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        Task<bool> ChangeStatusAsync(IEnumerable<int> ids, ProductStatus status);

        /// <summary>
        /// 删除商品
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int id);

        /// <summary>
        /// 批量删除商品
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(IEnumerable<int> ids);


    }
}
